<template>
  <div class="box">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="问卷调查" name="first">
        <ul>
          <li v-for="item in ClassroomList" :key="item.id" @click="GoQuestionnaire">
            <span class="Classroom-new">{{item.title}}</span>
            <span class="Classroom-time">{{item.beginTime}}</span>
          </li>
        </ul>
        <div v-if="ClassroomList.length>0">
          <Pagination-two :total="total" :params="params" :get="get"></Pagination-two>
        </div>
      </el-tab-pane>
      <el-tab-pane label="工作评估" name="second">
        <ul>
          <li v-for="item in ClassroomList2" :key="item.id" @click="GoJobEvaluation">
            <span class="Classroom-new">{{item.title}}</span>
            <span class="Classroom-time">{{item.opTime}}</span>
          </li>
        </ul>
        <div v-if="ClassroomList2.length>0">
          <Pagination-two :total="total2" :params="params2" :get="gett"></Pagination-two>
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import PaginationTwo from "@/components/Pagination/PaginationTwo.vue";
export default {
  components: {
    PaginationTwo,
  },
  data() {
    return {
      activeName: "first",
      ClassroomList: [],
      ClassroomList2: [],
      // 总条数
      total: 0,
      total2: 0,
      //  参数1
      params: {
        pageNum: 1,
        pageSize: 10,
      },
      //  参数2
      params2: {
        pageNum: 1,
        pageSize: 10,
      },
    };
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event);
    },
    GoQuestionnaire() {
      this.$router.push("/questionnaire");
    },
    GoJobEvaluation() {
      this.$router.push("/jobevaluation");
    },
    //问卷调查
    get() {
      this.Api.getquestionnaire(this.params).then((res) => {
        if (res.code == 0) {
          this.ClassroomList = res.data.records;
          // console.log(this.ClassroomList2);
          this.total=res.data.total
        }
      });
    },
    //工作评估列表
    gett() {
      this.Api.getjbEV(this.params2).then((res) => {
        if (res.code == 0) {
          this.ClassroomList2 = res.data.records;
          // console.log(this.ClassroomList2);
          this.total2=res.data.total
        }
      });
    },
  },
  created() {
    //工作评估列表
    this.gett();
    //问卷调查
    this.get();
  },
};
</script>
<style  scoped>
ul li {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid #e8e8e8;
  width: 918px;
}
ul li .Classroom-new {
  font-size: 16px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: rgba(51, 51, 51, 1);
  line-height: 66px;
}
ul li .Classroom-time {
  font-size: 16px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: rgba(153, 153, 153, 1);
  line-height: 66px;
}
li span:first-child:hover {
  color: red;
}
.box {
  padding: 41px 40px;
  background: white;
  min-height: 546px;
  width: 920px;
}
</style>